package version2024.easy;

import java.util.Scanner;

/**
 * @author sunhl
 * @Description: HJ97 记负均正II
 * @Date: created in 2025/1/11 星期六 17:07
 * @Modified By:
 */
public class HJ105_RecordNegativeAveragePositiveII {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int countNegative = 0;
        int countPositive = 0;
        int sum = 0;
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case

            int number = in.nextInt();
            if (number < 0) {
                countNegative++;
            } else if (number > 0) {
                sum += number;
                countPositive++;
            }
        }
        // 处理正数的数量为0的情况
        double average = countPositive == 0 ? 0.0 : sum * 1.0 / countPositive;
        System.out.println(countNegative);
        System.out.println(String.format("%.1f", average));
    }
}
